ZoomWindow
Use theZoomWindow
procedure to zoom the window when the user has pressed and released the mouse button with the cursor in the zoom box.
PROCEDURE ZoomWindow (theWindow: WindowPtr; partCode: Integer; front: Boolean);
theWindow
- A pointer to the window record of the window to be zoomed.
partCode
- The result (either
inZoomIn
orinZoomOut
) returned by theFindWindow
function.front
- A Boolean value that determines whether the window is to be brought to the front. If the value of
front
isTRUE
, the window necessarily becomes the frontmost, active window. If the value offront
isFALSE
, the window's position in the window list does not change. Note that if a window was active before it was zoomed, it remains active even if the value offront
isFALSE
.DESCRIPTION
TheZoomWindow
procedure zooms a window in or out, depending on the value of
thepartCode
parameter. Your application callsZoomWindow
, passing it the part
code returned byFindWindow
, when it receives a result ofTRUE
fromTrackBox
.
TheZoomWindow
procedure then changes the window's port rectangle to either
the user state (if the part code isinZoomIn
) or the standard state (if the part code isinZoomOut
), as stored in the window state data record, described in the section "Zooming a Window" beginning on page 4-53.If the part code is
inZoomOut
, your application ordinarily calculates and sets the standard state before callingZoomWindow
.For best results, call the QuickDraw procedure
EraseRect
, passing the window's graphics port as the port rectangle, before callingZoomWindow
.SEE ALSO
See Listing 4-12 on page 4-55 for an example that calculates and sets the standard state and then callsZoomWindow
to zoom a window.